﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GMS.Client.Core
{
    /// <summary>
    /// 按钮类
    /// </summary>
    public class Button : CustomControl
    {
        public Button(IntPtr parentHandle, string className, string titleName, CustomControlNameType customControlNameType) :
            base(parentHandle, className, titleName, customControlNameType)
        { }

        public Button(IntPtr handle, CustomControlNameType customControlNameType) : base(handle, customControlNameType) { }

        /// <summary>
        /// 是否可点击
        /// </summary>
        public bool CanClick { get; set; }

        /// <summary>
        /// 点击
        /// </summary>
        public void Click()
        {
            Win32API.SendMessage(base.Handle, (int)WindowsMessageType.BM_CLICK, 0, 0);
        }
    }
}
